set(target lzm_log)

message(STATUS "iot log")

if (0) # [lzm][todo]在支持多个log库时再启用
add_library(${target} STATIC)
target_link_libraries(${target} PRIVATE  lzm_mlog)

# log
target_include_directories(${target} PUBLIC ${LZM_USER_INC} 
                                            ./lzm_logal_api)

set(src_log
        ./lzm_logal_api/lzm_logal_api.c
)

target_sources(${target} PRIVATE
    ${src_log}
)

# add lzm_mlog
add_subdirectory(lzm_mlog)

else()
add_library(${target} STATIC)

# log
target_include_directories(${target} PUBLIC ${LZM_USER_INC} 
                                            ./lzm_logal_api
                                            ./lzm_mlog/inc
                                            ./lzm_mlog/port)

set(src_log
        ./lzm_logal_api/lzm_logal_api.c
        ./lzm_mlog/src/lzm_mlog.c
        ./lzm_mlog/port/lzm_mlog_port.c
)

target_sources(${target} PRIVATE
    ${src_log}
)
endif()

set(LZM_ALL_LIBS "${LZM_ALL_LIBS};${target}" CACHE INTERNAL "")
